#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(void)
{
    close(1);//关闭标准输出流-屏幕
    umask(0);
    int fd=open("test.txt",O_WRONLY|O_CREAT,0666);
    printf("fd:%d\n",fd);
    printf("hello world\n");
    printf("hello world\n");
    return 0;
}
